package demo.spring.batis.dao;

import java.util.List;
import demo.spring.batis.mapper.DemoMapper;
import demo.spring.batis.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by Qian on 2017/3/2.
 */
@Repository
public class DemoDao {
    @Autowired
    private DemoMapper demoMapper;
    public void add(UserModel userModel) {
       demoMapper.add(userModel);
    }

    public void delete(String name) {
        demoMapper.delete(name);
    }

    public void update(UserModel userModel) {
        demoMapper.update(userModel);
    }

    public List<UserModel> getAll() {
     return  demoMapper.getAll();

    }

    public List<UserModel> select(String name) {
        return  demoMapper.select(name);
    }
}
